#设置cmake最低版本
cmake_minimum_required(VERSION 3.4.1)

#设置项目名称
project(tst_qtbase_auto_integration_none)

#引入add_module模板文件
include(${ISSQTTESTROOTDIR}/cmake/add_module.cmake)

#设置测试类型，auto为自动测试，manual为手动测试,即test目录下的文件夹名
set(TEST_TYPE auto)
#设置模块名
set(MODULE qtbase)
#设置需要链接的模块
set(LinkQt Core Gui Widgets Network Concurrent OpenGL Sql Svg Quick Xml PrintSupport)
#设置需要链接的模块的私有模块
set(LinkQtPrivate Core Test Gui Widgets Sql Network OpenGL Concurrent PrintSupport)

add_definitions("-DQT_DISABLE_DEPRECATED_BEFORE=0"
                "-DSRCDIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\"")
get_filename_component(CMAKE_NATIVE_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM} NAME)
add_definitions(-DDEFAULT_MAKESPEC="${CMAKE_NATIVE_MAKE_PROGRAM}")


set(CodeRootPath ${ISSQTTESTROOTDIR}/qtbase)
include_directories(${CodeRootPath}/3rdparty/tinycbor/src
                    ${CodeRootPath}/3rdparty/tinycbor/tests
                    ${CodeRootPath}/3rdparty/tinycbor/tests/encoder
                    ${CodeRootPath}/3rdparty/tinycbor/tests/parser
                    ${CodeRootPath}/tests/auto/other/qvariant_common
                    ${CodeRootPath}/tests/auto/corelib/kernel/qcoreapplication
                    ${CodeRootPath}/tests/baselineserver/shared
                    ${CodeRootPath}/tests/
                    ${CodeRootPath}/tests/auto/other/qabstractitemmodelutils
                    ${CodeRootPath}/tests/shared
                    ${CodeRootPath}/tests/auto/corelib/kernel/qmetatype)

#多级目录
set(TEST_ITEMS ${TEST_ITEMS}
      testlib/selftests/deleteLater_noApp
      corelib/global/qglobal
      network/kernel/qdnslookup_appless
      corelib/io/qprocess-noapplication
      corelib/tools/qcommandlineparser
      sql/kernel/qsql

      network/bearer/qnetworkconfigurationmanagerqappless
)

add_sources(
    corelib/global/qglobal/qglobal.c
)

set(EXCLUDE_SRC ${EXCLUDE_SRC}
    corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
)


#0为使用widget_main，1为使用gui_main,2使用core_main,3使用appless_main，4或其他使用none_main
set(MANUAL_ADD_MAIN 3)

set(PLUGINS QOpenHarmonyPlatformIntegrationPlugin)
#再把TEST_ITEMS传给create_library整合测试项，生成测试库
#整合测试项，生成测试库，名字当前工程名，即project(tst_qtcharts_auto)中定义的tst_qtcharts_auto
create_library(${TEST_ITEMS})

